All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.undo.AbstractUndoableEdit
java.lang.Object
|
+----com.sun.java.swing.undo.AbstractUndoableEdit
- public class AbstractUndoableEdit
- extends Object
- implements UndoableEdit
An abstract implementation of UndoableEdit, implementing simple
responses to all boolean methods in that interface.
-
RedoName
- String returned by getRedoPresentationName()
-
UndoName
- String returned by getUndoPresentationName()
-
AbstractUndoableEdit()
-
-
addEdit(UndoableEdit)
- This default implementation returns false.
-
canRedo()
- Returns true if this edit is alive and hasBeenDone is false.
-
canUndo()
- Returns true if this edit is alive and hasBeenDone is true.
-
die()
- Sets alive to false.
-
getPresentationName()
- This default implementation returns "".
-
getRedoPresentationName()
- If getPresentationName() returns "", returns
AbstractUndoableEdit.RedoName.
-
getUndoPresentationName()
- If getPresentationName() returns "", returns
AbstractUndoableEdit.UndoName.
-
isSignificant()
- This default implementation returns true.
-
redo()
- Throws CannotRedoException if canRedo() returns false.
-
replaceEdit(UndoableEdit)
- This default implementation returns false.
-
toString()
-
-
undo()
- Throws CannotUndoException if canUndo() returns false.
UndoName
protected static final String UndoName
- String returned by getUndoPresentationName()
RedoName
protected static final String RedoName
- String returned by getRedoPresentationName()
AbstractUndoableEdit
public AbstractUndoableEdit()
die
public void die()
- Sets alive to false. Note that this is a one way operation:
dead edits cannot be resurrected. Sending undo() or redo() to
a dead edit results in an exception being thrown.
Typically an edit is killed when it is consolidated by another
edit's addEdit() or replaceEdit() method, or when it is
dequeued from an UndoManager
undo
public void undo() throws CannotUndoException
- Throws CannotUndoException if canUndo() returns false. Sets
hasBeenDone to false. Subclasses should override to undo the
operation represented by this edit. Override should begin with
a call to super.
- See Also:
- canUndo
canUndo
public boolean canUndo()
- Returns true if this edit is alive and hasBeenDone is true.
- See Also:
- die, undo, redo
redo
public void redo() throws CannotRedoException
- Throws CannotRedoException if canRedo() returns false. Sets
hasBeenDone to true. Subclasses should override to redo the
operation represented by this edit. Override should begin with
a call to super.
- See Also:
- canRedo
canRedo
public boolean canRedo()
- Returns true if this edit is alive and hasBeenDone is false.
- See Also:
- die, undo, redo
addEdit
public boolean addEdit(UndoableEdit anEdit)
- This default implementation returns false.
- See Also:
- addEdit
replaceEdit
public boolean replaceEdit(UndoableEdit anEdit)
- This default implementation returns false.
- See Also:
- replaceEdit
isSignificant
public boolean isSignificant()
- This default implementation returns true.
- See Also:
- isSignificant
getPresentationName
public String getPresentationName()
- This default implementation returns "". Used by
getUndoPresentationName() and getRedoPresentationName() to
construct the strings they return. Subclasses shoul override to
return an appropriate description of the operation this edit
represents.
- See Also:
- getUndoPresentationName, getRedoPresentationName
getUndoPresentationName
public String getUndoPresentationName()
- If getPresentationName() returns "", returns
AbstractUndoableEdit.UndoName. Otherwise returns
AbstractUndoableEdit.UndoName followed by a space and
getPresentationName()
- See Also:
- getPresentationName
getRedoPresentationName
public String getRedoPresentationName()
- If getPresentationName() returns "", returns
AbstractUndoableEdit.RedoName. Otherwise returns
AbstractUndoableEdit.RedoName followed by a space and
getPresentationName()
- See Also:
- getPresentationName
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index